Samuel 1 26:19 Halakha : Mishneh Torah, Kings and Wars

וְעַתָּ֗ה יִֽשְׁמַֽע־נָא֙ אֲדֹנִ֣י הַמֶּ֔לֶךְ אֵ֖ת דִּבְרֵ֣י עַבְדּ֑וֹ אִם־יְהוָ֞ה הֱסִֽיתְךָ֥ בִי֙ יָרַ֣ח מִנְחָ֔ה וְאִ֣ם ׀ בְּנֵ֣י הָאָדָ֗ם אֲרוּרִ֥ים הֵם֙ לִפְנֵ֣י יְהוָ֔ה כִּֽי־גֵרְשׁ֣וּנִי הַיּ֗וֹם מֵהִסְתַּפֵּ֜חַ בְּנַחֲלַ֤ת יְהוָה֙ לֵאמֹ֔ר לֵ֥ךְ עֲבֹ֖ד אֱלֹהִ֥ים אֲחֵרִֽים׃

Et maintenant, que mon seigneur le roi daigne écouter les paroles de son serviteur: si c’est l’Éternel qui t’a excité contre moi, qu’il accueille mon offrande; mais si ce sont des hommes, ils seront maudits de Dieu, parce qu’ils m’ont empêché, en me chassant, de m’attacher à l’héritage de l’Éternel et m’ont dit: Va servir des dieux étrangers!

Mishneh Torah, Kings and Wars

A person should always dwell in Eretz Yisroel, even in a city where most of the residents are not Jewish, rather than live outside of the Land in a city where most of the residents are Jewish. For anyone who leaves the Land is considered as if he worships idols, as it says, “for they have driven me out this day that I should not cleave to the inheritance of the Lord, saying, ‘go serve other gods’” (I Samuel 26:19). And regarding the calamities it says, “Neither shall they enter into the land of Israel” (Ezekiel 13:9). Just as it is forbidden to leave the Land, so it is forbidden to leave Babylon for any other country, as it says, “They shall be carried to Babylon, and there shall they be” (Jeremiah 27:22).